package com.androidx.p013lv.mine.novel.adpter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.novel.AttentionNovelAnchorBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.base.view.CircleImageView;
import com.androidx.p013lv.mine.C1207R;

/* renamed from: com.androidx.lv.mine.novel.adpter.MineAttentionNovelAdapter */
public class MineAttentionNovelAdapter extends BaseRecyclerAdapter<AttentionNovelAnchorBean.AttentionNovelAnchorBeanData, Holder> {
    String domain;

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((AttentionNovelAnchorBean.AttentionNovelAnchorBeanData) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1207R.C1212layout.item_attention_novel, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.mine.novel.adpter.MineAttentionNovelAdapter$Holder */
    public class Holder extends BaseRecyclerHolder {
        CircleImageView iv_cover;
        RelativeLayout rl_content;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.rl_content = (RelativeLayout) view.findViewById(C1207R.C1210id.rl_content);
            this.iv_cover = (CircleImageView) view.findViewById(C1207R.C1210id.iv_cover);
            this.tv_title = (TextView) view.findViewById(C1207R.C1210id.tv_title);
            ViewGroup.LayoutParams layoutParams = this.rl_content.getLayoutParams();
            layoutParams.width = (UiUtils.getWindowWidth() - UiUtils.dp2px(72)) / 3;
            layoutParams.height = UiUtils.dp2px(116);
            this.rl_content.setLayoutParams(layoutParams);
        }

        public void setData(AttentionNovelAnchorBean.AttentionNovelAnchorBeanData attentionNovelAnchorBeanData, int i) {
            if (attentionNovelAnchorBeanData.getAnchorLogo() == null || TextUtils.isEmpty(attentionNovelAnchorBeanData.getAnchorLogo())) {
                GlideUtils.loadCropRadiusDefault(6, this.iv_cover);
            } else {
                GlideUtils.loadCropRadiusWh2(MineAttentionNovelAdapter.this.domain + attentionNovelAnchorBeanData.getAnchorLogo(), 6, this.iv_cover, 600);
            }
            TextView textView = this.tv_title;
            textView.setText(attentionNovelAnchorBeanData.getAnchorName() + "");
        }
    }
}
